package com.study.spring;

import com.study.domain.Person;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;

/**
 * Created by tan on 2017/6/26.
 */
public class BeanWrapperTest {
	public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
		Object person = Class.forName("com.study.domain.Person").newInstance();

		BeanWrapper newsPerson = new BeanWrapperImpl(person);
		newsPerson.setPropertyValue("name","haiyuan");
		newsPerson.setPropertyValue("age","10");
		System.out.println(newsPerson.getWrappedInstance() instanceof Person);
	}
}
